<div>
    <form class="form-horizontal bv-form"  id="editForm" role="form" >
        <input type="hidden" name="lb_id" value="{$data['lb_id']}">
        <legend>基本信息</legend>
        <div class="form-group">
            <label class="col-sm-3 control-label">轮播图名称</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" name="lb_name" value="{$data['lb_name']}" >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">轮播图</label>
            <div class="col-sm-5">
                <a href="javascript:;" class="file">
                    <input type="file" name="lb_image"  onchange="aaaa(this);">
                </a>
                <span style="font-size:10px;color:red">* 图片不大于2M 格式JPG,PNG,JPEG</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">预览图</label>
            <div class="col-sm-3" id="androimg" style="float:left">
                <img src="{$data['lb_image']}" alt="" style="width:180px;height:100px;">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">内容</label>
        </div>
        <div id="editor">
            {$data['lb_content']}
        </div>
        <textarea name="con" id="con" style="display: none;"></textarea>
        <div class="form-group">
            <label class="col-sm-3 control-label">状态</label>
            <div class="col-sm-6">
                <select name="lb_status" style="width:140px;font-size: 13px;" class="SearchForm form-control">
                    <option value="1" {eq name="$data['lb_status']" value="1"}selected{/eq}>启用</option>
                    <option value="2" {eq name="$data['lb_status']" value="2"}selected{/eq}>禁用</option>
                </select>
            </div>
        </div>
        </fieldset>
    </form>
</div>
<script type="text/javascript" src="vendor/wangEditor/release/wangEditor.js"></script>
<script>
    var E = window.wangEditor;
    var editor = new E('#editor');
    editor.customConfig.uploadImgServer = 'admin/Information/mww';
    //editor.customConfig.uploadImgShowBase64 = true;
    // 或者 var editor = new E( document.getElementById('editor') )
    editor.customConfig.uploadFileName = 'thumb';
    editor.customConfig.uploadImgMaxSize = 2 * 1024 * 1024;
    editor.customConfig.uploadImgHooks = {
        customInsert: function (insertImg, result, editor) {
            // 图片上传并返回结果，自定义插入图片的事件（而不是编辑器自动插入图片！！！）
            // insertImg 是插入图片的函数，editor 是编辑器对象，result 是服务器端返回的结果
            // 举例：假如上传图片成功后，服务器端返回的是 {url:'....'} 这种格式，即可这样插入图片：
            var url = result.url;
            insertImg(url)
            // result 必须是一个 JSON 格式字符串！！！否则报错
        }
    };
    editor.create();
    function aaaa(file) {
        var prevDiv = document.getElementById('androimg');
        if (file.files && file.files[0])
        {
            var reader = new FileReader();
            reader.onload = function(evt){
                prevDiv.innerHTML = '<img src="' + evt.target.result + '" height="100" width="180"/>';
            }
            reader.readAsDataURL(file.files[0]);
        }
        else
        {
            prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
        }
    }
</script>